<?php
/**
 * 生成静态-新增新闻时更新所有相关页面
 * @final
 */
final class Staticizer_Apps_News_Event_Add extends Staticizer
{
    public function Build($param=NULL)
    {
        if(!$param){
            return FALSE;
        }

        #获取数据
        $data=$param;

        #首页
        //船厂订单
        if($data['SubclassID']==DAO_NewsClass::SHIPYARD_ORDERSHEET_ID){
            StaticizerFactory::Create('index.shipyard_ordersheet')->Build();
        }
        //船配订单
        if($data['SubclassID']==DAO_NewsClass::ANCILLARY_ORDERSHEET_ID){
            StaticizerFactory::Create('index.ancillary_ordersheet')->Build();
        }   
        //头条新闻
        if($data['M_IsHeadline']){
            StaticizerFactory::Create('index.headline')->Build();
        }
        //推荐新闻
        if($data['M_IsRecommend']){
            StaticizerFactory::Create('index.recommend')->Build();
        }
        //热点排行
        StaticizerFactory::Create('index.ranking')->Build();
        //船舶
        if($data['ClassID']==DAO_NewsClass::SHIPYARD_ID){
            StaticizerFactory::Create('index.shipyard')->Build();
        }
        //船配
        if($data['ClassID']==DAO_NewsClass::ANCILLARY_ID){
            StaticizerFactory::Create('index.ancillary')->Build();
        }
        //船运
        if($data['ClassID']==DAO_NewsClass::SHIPPING_ID){
            StaticizerFactory::Create('index.shipping')->Build();
        }
        //数据
        if($data['ClassID']==DAO_NewsClass::DATA_ID){
            StaticizerFactory::Create('index.data')->Build();
        }


        #资讯首页
        //头条新闻
        if($data['M_IsHeadline']){
            StaticizerFactory::Create('news.index_headline')->Build();
        }
        //推荐新闻
        if($data['M_IsRecommend']){
            StaticizerFactory::Create('news.index_recommend')->Build();
        }
        //热点排行
        StaticizerFactory::Create('news.index_ranking')->Build();

        //船舶行情
        if($data['SubclassID']==DAO_NewsClass::SHIPYARD_CONJUNCTURE_ID){
            StaticizerFactory::Create('news.index_conjuncture')->Build();
        }
        //船厂动态
        if($data['SubclassID']==DAO_NewsClass::SHIPYARD_TRENDS_ID){
            StaticizerFactory::Create('news.index_trends')->Build();
        }
        //船厂订单
        if($data['SubclassID']==DAO_NewsClass::SHIPYARD_ORDERSHEET_ID){
            StaticizerFactory::Create('news.index_ordersheet')->Build();
        }
        //运行分析
        if($data['SubclassID']==DAO_NewsClass::SHIPYARD_ANALYSIS_ID){
            StaticizerFactory::Create('news.index_analysis')->Build();
        }

        //船配资讯
        if($data['SubclassID']==DAO_NewsClass::ANCILLARY_NEWS_ID) {
            StaticizerFactory::Create('news.index_ancillary_message')->Build();
        }
        //船配订单
        if($data['SubclassID']==DAO_NewsClass::ANCILLARY_ORDERSHEET_ID){
            StaticizerFactory::Create('news.index_ancillary_ordersheet')->Build();
        }
        //钢材行情
        if($data['SubclassID']==DAO_NewsClass::ANCILLARY_STEELS_ID){
            StaticizerFactory::Create('news.index_ancillary_steels')->Build();
        }

        //船运市场
        if($data['SubclassID']==DAO_NewsClass::SHIPPING_MARKET_ID){
            StaticizerFactory::Create('news.index_shipping_market')->Build();
        }
        //船东动态
        if($data['SubclassID']==DAO_NewsClass::SHIPPING_TRENDS_ID){
            StaticizerFactory::Create('news.index_shipping_trends')->Build();
        }
        
        //海工动态
        if($data['SubclassID']==DAO_NewsClass::MARITIMEWORKS_TRENDS_ID){
            StaticizerFactory::Create('news.index_maritimeworks_trends')->Build();
        }
        //海工订单
        if($data['SubclassID']==DAO_NewsClass::MARITIMEWORKS_ORDERSHEET_ID){
            StaticizerFactory::Create('news.index_maritimeworks_ordersheet')->Build();
        }

        //数据-新造船市场
        if($data['SubclassID']==DAO_NewsClass::DATA_NEW_ID){
            StaticizerFactory::Create('news.index_data_new')->Build();
        }
        //数据-二手船市场
        if($data['SubclassID']==DAO_NewsClass::DATA_SECOND_ID){
            StaticizerFactory::Create('news.index_data_second')->Build();
        }
        //数据-拆船市场
        if($data['SubclassID']==DAO_NewsClass::DATA_SCRAP_ID){
            StaticizerFactory::Create('news.index_data_scrap')->Build();
        }
        //数据-船运市场
        if($data['SubclassID']==DAO_NewsClass::DATA_SHIPPING_ID){
            StaticizerFactory::Create('news.index_data_shipping')->Build();
        }
        //数据-钢材市场
        if($data['SubclassID']==DAO_NewsClass::DATA_STEELS_ID){
            StaticizerFactory::Create('news.index_data_steels')->Build();
        }
        //数据-租船市场
        if($data['SubclassID']==DAO_NewsClass::DATA_RENT_ID){
            StaticizerFactory::Create('news.index_data_rent')->Build();
        }

        //融资-信贷政策
        if($data['SubclassID']==DAO_NewsClass::FINACING_POLICY_ID){
            StaticizerFactory::Create('news.index_finacing_policy')->Build();
        }
        //融资-银企合作
        if($data['SubclassID']==DAO_NewsClass::FINACING_COOPERATION_ID){
            StaticizerFactory::Create('news.index_finacing_cooperation')->Build();
        }
        //融资-融资动态
        if($data['SubclassID']==DAO_NewsClass::FINACING_TRENDS_ID){
            StaticizerFactory::Create('news.index_finacing_trends')->Build();
        }
        //融资-融资上市
        if($data['SubclassID']==DAO_NewsClass::FINACING_IPO_ID){
            StaticizerFactory::Create('news.index_finacing_ipo')->Build();
        }

        //法规
        if($data['ClassID']==DAO_NewsClass::LAW_ID){
            StaticizerFactory::Create('news.index_law')->Build();
        }
        //船型
        if($data['ClassID']==DAO_NewsClass::TYPE_ID){
            StaticizerFactory::Create('news.index_type')->Build();
        }
        //标准
        if($data['ClassID']==DAO_NewsClass::STANDARD_ID){
            StaticizerFactory::Create('news.index_standard')->Build();
        }
        //技术
        if($data['ClassID']==DAO_NewsClass::TECHNOLOGY_ID){
            StaticizerFactory::Create('news.index_technology')->Build();
        }


        #资讯模块-共享
        //最新新闻
        StaticizerFactory::Create('news.latest')->Build();
        //数据
        if($data['ClassID']==DAO_NewsClass::DATA_ID){
            StaticizerFactory::Create('news.data')->Build();
        }
        //法规
        if($data['ClassID']==DAO_NewsClass::LAW_ID){
            StaticizerFactory::Create('news.law')->Build();
        }

        
        #新闻内容页
        StaticizerFactory::Create('news.content')->Build(array
        (
            'ID'=>$data['ID'],
            'Action'=>'Add'
        ));
    }
}
?>